//
//  MoreCollectionViewCell.m
//  HappyBaby
//
//  Created by lanou on 15/11/28.
//  Copyright © 2015年 华哥. All rights reserved.
//

#import "MoreCollectionViewCell.h"
#import "Define.h"
#import "UIImageView+WebCache.h"

@interface MoreCollectionViewCell ()
@property(nonatomic,strong)UIImageView *icon;
@property(nonatomic,strong)UILabel *text;
@end

@implementation MoreCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        CGFloat width = (kScreenWidth -21)/2;
        CGFloat height = width*340/680;
        self.icon = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, width, height)];
        //self.icon.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:self.icon];
        
        self.text = [[UILabel alloc]initWithFrame:CGRectMake(0, height, width, 20)];
        self.text.font = [UIFont systemFontOfSize:13];
        //self.text.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.text];
        
    }
    
    
    return self;
    
    
}

- (void)setModel:(ThreeModel *)model
{
    
    _model = model;
    [self.icon sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:[UIImage imageNamed:@"2.png"]];
    self.text.text = model.title;
    
    
}







@end
